package com.example.statemachine.guard;

import com.example.statemachine.StatesEvents;
import lombok.extern.slf4j.Slf4j;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.guard.Guard;
import org.springframework.stereotype.Component;

/**
 * @Author: leizj
 * @Desc:
 */
@Slf4j
@Component
public class StartToNewGuard implements Guard<StatesEvents.State, StatesEvents.Event> {
    @Override
    public boolean evaluate(StateContext<StatesEvents.State, StatesEvents.Event> stateContext) {
        log.info("StartToNewGuard stateContext: {}", stateContext);
        log.info("StartToNewGuard stateContext: {}", stateContext.getEvent());
        return true;
    }
}
